"""
首页对象
"""
from selenium.webdriver.common.by import By
from base.base_page import BasePage, BaseProxy


class SettingPage(BasePage):
    def __init__(self):
        super().__init__()
        self.quit_login = (By.ID, 'com.bjcsxq.chat.carfriend:id/set_logout_tv')
        self.logout_sure_btn = (By.ID, 'com.bjcsxq.chat.carfriend:id/bt_ok')

    def find_quit_logine_btn(self):
        return self.get_element(self.quit_login)

    def find_logout_suer_btn(self):
        return self.get_element(self.logout_sure_btn)

class SettingHandler:

    def __init__(self):
        self.setting_page = SettingPage()

    def click_quit_login_button(self):
        self.setting_page.find_quit_logine_btn().click()

    def click_logout_sure_button(self):
        self.setting_page.find_logout_suer_btn().click()



class SettingProxy(BaseProxy):

    def __init__(self):
        super().__init__()
        self.setting_handler = SettingHandler()

    def quit_login(self):
        """
        退出登录状态
        :return:
        """
        self.setting_handler.click_quit_login_button()
        self.setting_handler.click_logout_sure_button()


if __name__ == '__main__':
    pass